package com.itheima.vo;

import com.itheima.domain.CompanyAddress;
import com.itheima.domain.OrderReturnApply;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * 退货申请详情返回对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderReturnApplyVo extends OrderReturnApply implements Serializable {
    private CompanyAddress companyAddress;

    public static OrderReturnApplyVo init(OrderReturnApply returnApply, CompanyAddress companyAddress) {
        OrderReturnApplyVo vo = new OrderReturnApplyVo();
        BeanUtils.copyProperties(returnApply, vo);
        vo.setCompanyAddress(companyAddress);
        return vo;
    }
}